<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"
	xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
	layout:decorator="layout/default">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>客户列表</title>
</head>
<body>
	<div layout:fragment="content">
		<div class="row" style="margin-bottom: 12px;">
			<div th:replace="fragments/searchBox::topSearch"></div>
			<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
				<shiro:hasPermission name="customer:new">
					<a type="button" class="btn btn-sm btn-success pull-right"
						title="创建新客户" th:href="@{/customers/new}">创建新客户</a>
				</shiro:hasPermission>
			</div>
		</div>
		<div class="row">
			<div class="col-lg-12 col-md-12 col-sm-12 xol-xs-12">
				<div th:unless="${#lists.isEmpty(page.list)}"
					th:assert="${page.list}"
					th:replace="customer/index::showCustomers(${page.list})"></div>
				<div th:assert="${page}"
					th:replace="fragments/pagination::pagination(${'/customers'}, ${page})"></div>
			</div>
		</div>
	</div>

	<div id="pp" class="easyui-pagination"
		style="background: #efefef; border: 1px solid #ccc;"
		data-options="total:2000,pageSize:10"></div>

	<div class="table-responsive" th:fragment="showCustomers(customerList)">
		<table class="table table-striped table-hover table-condensed">
			<thead>
				<tr>
					<th>客户代码</th>
					<th>国家</th>
					<th>客户名称</th>
					<th>有效</th>
					<th>创建时间</th>
					<th>更新时间</th>
				</tr>
			</thead>
			<tbody>
				<tr data-th-each="customer, state: ${customerList}"
					data-th-object="${customer}">
					<td><a data-th-href="@{/customers/{id}(id=*{customerId})}"
						data-th-text="*{accountNumber}"></a></td>
					<td data-th-text="*{country}"></td>
					<td data-th-text="*{customerName}"></td>
					<td data-th-text="*{available}"></td>
					<td
						data-th-text="*{#dates.format(createdTime, 'yyyy-MM-dd HH:mm:ss')}"></td>
					<td
						data-th-text="*{#dates.format(updateTime, 'yyyy-MM-dd HH:mm:ss')}"></td>
				</tr>
			</tbody>
		</table>
	</div>
</body>
</html>
